package way.learning.zz.listener;

import way.learning.zz.event.IoErrorCeasedEvent;
import way.learning.zz.event.IoErrorRaisedEvent;

/**
 * A listener of {@link IoErrorRaisedEvent}/{@link IoErrorCeasedEvent} events
 *
 */
public interface IoErrorListener extends Rdp4jListener {

    /**
     * Invoked when an I/O error occurs in the DirectoryPoller
     * <p>
     * NOTE! Any consecutive poll-cycles with I/O errors will not fire
     * any {@link IoErrorRaisedEvent}, not until a {@link IoErrorCeasedEvent}
     * way.learning.zz.event has been fired first.
     * 
     */
    void ioErrorRaised(IoErrorRaisedEvent event) throws InterruptedException;

    /**
     * Invoked when the DirectoryPoller has recovered from an  I/O error.
     */
    void ioErrorCeased(IoErrorCeasedEvent event) throws InterruptedException;
}
